function I = insertItem(Q, collection_id,notes)

%takes collection_item and notes and constructs S3QL insert to insert and
%item and returns the string. Q is a struct with url and key to enter as
%desribed in s3db_read
%
%Romesh Stanislaus April 2010


if isnumeric(collection_id)
    collection_id = num2str(collection_id);
end
if isnumeric(notes)
    notes = num2str(notes);
else
    notes = '';
end

Ik = ['<S3QL><insert>item</insert><where><collection_id>',collection_id,...
    '</collection_id><notes>',notes,'</notes></where></S3QL>'];

Q.X = Ik;
[A1,Q]=s3db_read(Q); % -1  %insert item item in deployment
%disp(A1); %uncomment to test%%%%%%
if str2num(A1.error_code)
    error(A1)
end
%pause(3);
I = A1;
